package com.leo.train.business.controller.web;

import com.leo.train.business.dto.DailyTrainTicketDto;
import com.leo.train.business.entity.DailyTrainTicket;
import com.leo.train.business.service.DailyTrainTicketService;
import com.leo.train.common.resp.CommonResp;
import com.leo.train.common.resp.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/daily-trainTicket")
public class DailyTrainTicketController {

    @Autowired
    private DailyTrainTicketService dailyTrainTicketService;

    /**
     * 查询
     * @param dailyTrainTicketDto
     * @return
     */
    @GetMapping("/list")
    public CommonResp<PageResult<DailyTrainTicket>> list(DailyTrainTicketDto dailyTrainTicketDto) {
        PageResult<DailyTrainTicket> pageResult = dailyTrainTicketService.list(dailyTrainTicketDto);
        return new CommonResp<>(pageResult);
    }

}
